/**
 * Created by hxpeng on 2017/3/24.
 */
(function () {
    'use strict';

    angular.module('App.pages.member', [
        'App.pages.member.entrust',
        'ionic.rating'
    ]).config(routeConfig);

    function routeConfig($stateProvider) {
        $stateProvider.state('memberMenu', {
            url: "/member",
            abstract: true,
            templateUrl: 'source/pages/page-tab.html',
        }).state('memberMenu.addStudent', {
            url: "/addStudent",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/student/addStudent.html',
                    controller:'AddStudentCtrl as vm'
                }
            }
        }).state('memberMenu.parentIndex', {
            url: "/parentIndex",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/parent/index.html',
                    controller:'ParentCtrl as vm'
                }
            }
        }).state('memberMenu.parentInfo', {
            url: "/parentInfo/{studentId:string}",
            params: {
                studentId: null
            },
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/parent/parent-info.html',
                    controller:'ParentInfoCtrl as vm',
                    resolve: {
                        studentId: function($stateParams){
                            return $stateParams.studentId;
                        }
                    }
                }
            }
        }).state('memberMenu.albumIndex', {
            url: "/albumIndex",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/album/album-index.html',
                    controller:'AlbumCtrl as vm'
                }
            }
        }).state('memberMenu.albumCreate', {
            url: "/albumCreate",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/album/add-album.html',
                    controller:'AddAlbumCtrl as vm'
                }
            }
        }).state('memberMenu.chooseStudent', {
            url: "/chooseStudent?{nextState:string}",
            params: {
                nextState: null
            },
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/student/chooseStudent.html',
                    controller:'ChooseStudentCtrl as vm'
                }
            }
        }).state('memberMenu.edit', {
            url: "/edit",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/info/member-edit.html',
                    controller:'MemberEditCtrl as vm'
                }
            }
        }).state('memberMenu.memberOfFamily',{
            url: "/memberOfFamily/{studentId:string}",
            views:{
                'kinder-view':{
                    templateUrl: 'source/pages/member/rel/member-of-family.html',
                    controller:'MemberOfFamilyCtrl as vm',
                    resolve: {
                        id: function($stateParams){
                            return $stateParams.id;
                        }
                    }
                }
            }
        }).state('memberMenu.changeRel',{
            url:"/changeRel/{studentId:string}",
            views:{
                'kinder-view':{
                    templateUrl: 'source/pages/member/rel/change-rel.html',
                    controller:'ChangeRalCtrl as vm',
                    resolve: {
                        studentId: function($stateParams){
                            return $stateParams.studentId;
                        }
                    }
                }
            }
        }).state('memberMenu.mine',{
            url:"/mine",
            views:{
                'kinder-view':{
                    templateUrl: 'source/pages/member/rel/mine-menu.html',
                    controller:'MineMenuCtrl as vm',
                    // resolve: {
                    //     memberId: function($stateParams){
                    //         return $stateParams.memberId;
                    //     }
                    // }
                }
            }
        }).state('memberMenu.myInfo',{
            url:"/myInfo",
            views:{
                'kinder-view':{
                    templateUrl:'source/pages/member/rel/my-info.html',
                    controller:'MyInfoCtrl as vm',
                }
            }
        }).state('memberMenu.assessList', {
            url: '/assessList',
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/assess/assess-list.html',
                    controller: 'AssessListCtrl as vm'
                }
            }
        }).state('memberMenu.assessDetail', {
            url: '/assessDetail',
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/assess/assess-Detail.html',
                    controller: 'AssessDetailCtrl as vm'
                }
            }
        }).state('memberMenu.assessReport', {
            url: '/assessReport/:memberId',
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/assess/assess-Report.html',
                    controller: 'AssessReportCtrl as vm'
                }
            }
        });
    }
})();